<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<script>
			let arr = Array.of(1,2,1,3);
			console.log(arr.findIndex(item => item == 2));	//1
			
			//数组空位处理为undefined
			console.log([.1].findIndex(n => true));	//0
		</script>
	</body>
</html>
